import React from 'react';
import { Row, Col, Form, Input, Button } from 'antd';
const FormItem = Form.Item;

export default class LoginForm extends React.Component {
  static propTypes = {
    handleSubmit: React.PropTypes.func.isRequired
  }

  render() {
    const { getFieldDecorator } = this.props.form;

    return (
      <Form horizontal onSubmit={
          (e) => {
            e.preventDefault();
            this.props.handleSubmit(this.props.form.getFieldsValue());
          }
        }>
        <FormItem label="用户名">
          {getFieldDecorator('name')(
            <Input />
          )}
        </FormItem>
        <FormItem label="密码">
          {getFieldDecorator('password')(
            <Input type="password" />
          )}
        </FormItem>

        <Row type="flex" justify="space-between" align="bottom">
          <Col span={8}>
            <Button
             style={{backgroundColor: '#ff6c00', width: "100%", color: 'white', borderColor: '#ff6c00'}}
             size="large" type="primary" htmlType="submit">登录</Button>
          </Col>
          <Col span={6}>
            <a>忘记密码了?</a>
          </Col>
        </Row>
      </Form>
    );
  }
}
